﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogicCircuit
{
    [Serializable]
    public class Not : Element
    {
        public Not(int x, int y)
        {
            X = x;
            Y = y;
            Output = -1;
            type = "Not";
        }
        public Connection Input {get; set;}

        public int Output
        {
            get
            {
                if (Input != null)
                {
                    if (Input.Value == 0)
                        return 1;
                    else if (Input.Value == 1)
                        return 0;
                    else
                        return -1;
                }
                else
                    return -1;

            }
            set
            {
            }
        }
    }
}
